package com.xhwl.centiotdata.handler.security;

import com.xhwl.centiotdata.handler.light.LightIntegrationHandler;
import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: yanyixiong
 * @Description:
 * @Date: create in 10:43 2022/1/17
 */
public class SecurityIntegrationFactory {

    private static Map<Integer, SecurityIntegrationHandler> handlerMap = new HashMap<>();

    public static SecurityIntegrationHandler getInvokeStrategy(Integer id) {
        return handlerMap.get(id);
    }

    public static void register(Integer id, SecurityIntegrationHandler handler) {
        if (StringUtils.isEmpty(id)) {
            return;
        }
        handlerMap.put(id, handler);
    }

}
